using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Zhaoxi.MSACommerce.CategoryService.Core.Entities;

namespace Zhaoxi.MSACommerce.CategoryService.Infrastructure.Data.Configuration;

public class CategoryDbContext(DbContextOptions<CategoryDbContext> options):DbContext(options)
{
    public DbSet<Category> Category => Set<Category>();
    public DbSet<CategoryBrands> CategoryBrands => Set<CategoryBrands>();
    
    public DbSet<ParameterGroup> ParameterGroups => Set<ParameterGroup>();
    
    public DbSet<ParameterKey> ParameterKeys => Set<ParameterKey>();

   
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
    }
}